package com.learn.sqlsession.impl;

import com.learn.pojo.Configuration;
import com.learn.sqlsession.SqlSession;
import com.learn.sqlsession.SqlSessionFactory;

/**
 * @author WuLiangHang
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {
    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    public DefaultSqlSessionFactory() {
    }

    @Override
    public SqlSession openSession() {
        SqlSession session = new DefaultSqlSession(configuration);
        return session;
    }
}
